-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor RejectTransaction to CancelIOUTransaction #11720
Conversation
Looks like you modified Instead, all new API commands should use API.js, and follow our guidelines for writing new API commands. Unsure if your change is okay? Drop a note in #expensify-open-source! |
d1a1ec4
to
ff85464
Compare
@mountiny or @luacmartins Release conflicts, please! |
@Santhosh-Sellavel updated! |
LGTM! We should get someone internal to approve too |
Testing this now! |
#### WEB & DESKTOP
##### OFFLINE/ONLINE CANCEL
https://user-images.githubusercontent.com/85645967/200063620-7b2b6578-4b6f-43d7-b843-0c5300627573.mov
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checklist: #11720 (comment)
Recordings: #11720 (comment)
Only one unanswered question here. What about toggling balance?
As the above issue might be unrelated to this as it could occur during the creation flow also, so approving this one!
Looks good!
C+ Reviewed
🎀 👀 🎀
@Santhosh-Sellavel I address that comment here #11720 (comment). This is unrelated to this PR and I'll create another issue for this. |
Merging this PR since we have 3 approvals! |
Thanks everyone for the reviews and tests! |
@luacmartins looks like this was merged without the checklist test passing. Please add a note explaining why this was done and remove the |
Tests passed. Removing |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by @luacmartins in version: 1.2.25-0 🚀
|
🚀 Deployed to production by @yuwenmemon in version: 1.2.25-0 🚀
|
chatReport.maxSequenceNumber = newSequenceNumber; | ||
chatReport.lastReadSequenceNumber = newSequenceNumber; | ||
chatReport.lastMessageText = optimisticReportAction.message[0].text; | ||
chatReport.lastMessageHtml = optimisticReportAction.message[0].html; | ||
chatReport.hasOutstandingIOU = updatedIOUReport.total !== 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mutating an object that is stored in Onyx, This object is very likely to be used later as props of react components. Mutations make the ===
unreliable for checking if an object changed or not. I don't think we should be merging code with this sort of mutations.
Details
As part of the API unchained, we are refactoring our API calls so they are optimistic. Here the action of cancelling/declining a money request is made optimistic by creating the report action locally and then passing the new id to our API.
Thanks to this, user can cancel money request offline and if everything was fine, this will be autocompleted once they get online.
In case of error, red brick road will lead him to the error showing him that cancellation failed.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/213615
$ #8722
Tests
This must be tested alongside with https://github.com/Expensify/Web-Expensify/pull/35088
1. OFFLINE
2. ONLINE
PR Review Checklist
PR Author Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)QA Steps
Same as test steps.
Screenshots
Web
web.mov
Mobile Web - Chrome
Mobile Web - Safari
safari.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov